<tr>
    <!-- назначение -->
    <% if (announcement.get('operation') == "SALE") { %>
        <td>Для продажи</td>
    <%} else if (announcement.get('operation') == "RENT") { %>
        <td>Для аренды</td>
    <%} else { %>
        <td>Не указан</td>
    <%} %>

    <!-- статус -->
    <%if (announcement.get('status')) { %>
        <td>Активный</td>
    <% } else { %>
        <td>Скрытый</td>
    <% } %>

    <!-- тип -->
    <% var typeRealty = announcement.get('realty').escape('type'); %>
    <%
        var captionTypeRealty = "";
        switch (typeRealty) {
            case 'HOUSE':
                captionTypeRealty = 'Дом';
                break;
            case 'APARTMENT':
                captionTypeRealty = 'Квартира';
                break;
            case 'GARAGE':
                captionTypeRealty = 'Гараж';
                break;
            case 'LAND':
                captionTypeRealty = 'Земля';
                break;
            case 'OFFICE':
                captionTypeRealty = 'Офис';
                break;
            default:
                captionTypeRealty = 'Неизвестно';
        }
    %>
    <td><%= captionTypeRealty %></td>

    <!--адрес -->
    <td><%= announcement.get('realty').escape('adress') %></td>

    <!-- цена -->
    <td><%= announcement.escape('price') %></td>

    <!-- описание -->
    <td>
        <% if (typeRealty == "OFFICE" || typeRealty == "APARTMENT") { %>
            <strong> Этаж <%= announcement.get('realty').escape('level') %> </strong><br/>
        <% } %>
        <% if (typeRealty == "OFFICE" || typeRealty == "APARTMENT" || typeRealty == "HOUSE") { %>
            <strong> <%= announcement.get('realty').escape('numberRooms') %> комнат</strong><br/>
        <% } %>
        <% if (typeRealty == "OFFICE" || typeRealty == "APARTMENT" || typeRealty == "HOUSE" || typeRealty == "GARAGE") { %>
            <strong> Площадь: <%= announcement.get('realty').escape('area') %> кв. м. </strong><br/>
        <% } %>
        <%
        if (typeRealty == "LAND" || typeRealty == "HOUSE") {
            var typeMetricLandArea = "";
            switch(announcement.get('realty').escape('typeMetricLandArea')) {
                case 'ha':
                    typeMetricLandArea = "га";
                    break;
                case 'm2':
                    typeMetricLandArea = "кв. м.";
                    break;
                case '100m2':
                    typeMetricLandArea = "ар(100 кв. м.)";
                    break;
            }
        %>
            <strong> Площадь земли: <%= announcement.get('realty').escape('areaLand') + " " + typeMetricLandArea %></strong><br/>
        <%
        }
        %>

        <%= announcement.get('realty').escape('description') %>
    </td>

    <!-- действия -->
    <td>
        <a href="#deleteAnnouncement/<%= announcement.get('id') %>">Удалить</a> |
        <a href="#editAnnouncement/<%= announcement.get('id') %>">Изменить</a> |
        <a href="#addPhoto/<%= announcement.get('realty').get('id') %>">Добавить фото</a>
    </td>
</tr>